package com.changgou.search.listener;

import com.changgou.search.config.RabbitMQConfig;

/**
 * 监听商品下架,删除es库
 */
@Component
public class GoodsDownListener {

  @Autowired
  private ESManagerService esManagerService;

  @RabbitListener(queues = RabbitMQConfig.SEARCH_ADD_QUEUE)
  public void receiveMessage(String spuId) {
    System.out.println("接收到的消息为:  " + spuId);
    //调用业务层,删除索引库
    esManagerService.deleteDataBySpuId(spuId);
  }
}
